import request from '@/config/axios'

// 学生 VO
export interface DemoStudentVO {
  id: number // 编号
  name: string // 名字
  sex: number // 性别
  birthday: Date // 出生日期
  description: string // 简介
}

// 学生 API
export const DemoStudentApi = {
  // 查询学生分页
  getDemoStudentPage: async (params: any) => {
    return await request.get({ url: `/cms/demo-student/page`, params })
  },

  // 查询学生详情
  getDemoStudent: async (id: number) => {
    return await request.get({ url: `/cms/demo-student/get?id=` + id })
  },

  // 新增学生
  createDemoStudent: async (data: DemoStudentVO) => {
    return await request.post({ url: `/cms/demo-student/create`, data })
  },

  // 修改学生
  updateDemoStudent: async (data: DemoStudentVO) => {
    return await request.put({ url: `/cms/demo-student/update`, data })
  },

  // 删除学生
  deleteDemoStudent: async (id: number) => {
    return await request.delete({ url: `/cms/demo-student/delete?id=` + id })
  },

  // 导出学生 Excel
  exportDemoStudent: async (params) => {
    return await request.download({ url: `/cms/demo-student/export-excel`, params })
  }
}